﻿@model MaintenanceModel
@{
    //page title
    ViewBag.Title = T("Admin.System.Maintenance").Text;
}
<form asp-controller="Common" asp-action="Maintenance" method="post">
    
    <div class="row">
        <div class="col-md-12">
            <div class="x_panel light form-fit">
                <div class="x_title">
                    <div class="caption level-caption">
                        <i class="fa fa-database"></i>
                        @T("Admin.System.Maintenance")
                    </div>
                    <vc:admin-widget widget-zone="maintenance_buttons" additional-data="null" />
                </div>
                <div class="x_content form">
                    <vc:admin-widget widget-zone="maintenance_top" additional-data="null" />
                    <div class="form-horizontal">
                        <div class="form-body panel panel-default">
                            <div class="form-group">
                                <div class="note note-info">
                                    <strong>@T("Admin.System.Maintenance.DeleteGuests")</strong>
                                </div>
                            </div>
                            <div class="form-group">
                                <admin-label asp-for="DeleteGuests.StartDate" />
                                <div class="col-xs-8 col-md-4 col-sm-4">
                                    <admin-input asp-for="DeleteGuests.StartDate" />
                                </div>
                            </div>
                            <div class="form-group">
                                <admin-label asp-for="DeleteGuests.EndDate" />
                                <div class="col-xs-8 col-md-4 col-sm-4">
                                    <admin-input asp-for="DeleteGuests.EndDate" />
                                </div>
                            </div>
                            <div class="form-group">
                                <admin-label asp-for="DeleteGuests.OnlyWithoutShoppingCart" />
                                <div class="col-xs-8 col-md-4 col-sm-4">
                                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                                        <admin-input asp-for="DeleteGuests.OnlyWithoutShoppingCart" />
                                        <div class="control__indicator"></div>
                                    </label>
                                </div>
                            </div>
                            <div class="form-group">
                                <input type="submit" name="delete-guests" class="btn red col-md-offset-3" value="@T("Admin.Common.Delete")" />
                            </div>
                            @if (Model.DeleteGuests.NumberOfDeletedCustomers.HasValue)
                            {
                                <label class="col-md-offset-3">@string.Format(T("Admin.System.Maintenance.DeleteGuests.TotalDeleted").Text, Model.DeleteGuests.NumberOfDeletedCustomers.Value)</label>
                            }
                        </div>
                        <div class="form-body panel panel-default">
                            <div class="form-group">
                                <div class="note note-info">
                                    <strong>@T("Admin.System.Maintenance.ClearMostViewed")</strong>
                                </div>
                            </div>
                            <div class="form-group">
                                <input type="submit" name="clear-most-view" class="btn red col-md-offset-3" value="@T("Admin.Common.Delete")" />
                            </div>
                        </div>
                        <div class="form-body panel panel-default">
                            <div class="form-group">
                                <div class="note note-info">
                                    <strong>@T("Admin.System.Maintenance.DeleteExportedFiles")</strong>
                                </div>
                            </div>
                            <div class="form-group">
                                <admin-label asp-for="DeleteExportedFiles.StartDate" />:
                                <div class="col-xs-8 col-md-4 col-sm-4">
                                    <admin-input asp-for="DeleteExportedFiles.StartDate" />
                                </div>
                            </div>
                            <div class="form-group">
                                <admin-label asp-for="DeleteExportedFiles.EndDate" />:
                                <div class="col-xs-8 col-md-4 col-sm-4">
                                    <admin-input asp-for="DeleteExportedFiles.EndDate" />
                                </div>
                            </div>
                            <div class="form-group">
                                <input type="submit" name="delete-exported-files" class="btn red col-md-offset-3" value="@T("Admin.Common.Delete")" />
                            </div>
                            @if (Model.DeleteExportedFiles.NumberOfDeletedFiles.HasValue)
                            {
                                <label class="col-md-offset-3">@string.Format(T("Admin.System.Maintenance.DeleteExportedFiles.TotalDeleted").Text, Model.DeleteExportedFiles.NumberOfDeletedFiles.Value)</label>
                            }
                        </div>
                        <div class="form-body panel panel-default">
                            <div class="note note-info">
                                <strong>@T("Admin.System.Maintenance.DeleteActivityLog")</strong>
                            </div>
                            <div class="form-group">
                                <input type="submit" name="delete-activitylog" class="btn red col-md-offset-3" value="@T("Admin.Common.Delete")" />
                            </div>
                            @if (Model.DeleteActivityLog)
                            {
                                <div class="form-group">
                                    <label class="col-md-offset-3">@T("Admin.System.Maintenance.DeleteActivityLog.Deleted")</label>
                                </div>
                            }
                        </div>
                        <div class="form-body panel panel-default">
                            <div class="note note-info form-actions">
                                <strong>@T("Admin.System.Maintenance.ConvertPicture")</strong>
                            </div>
                            <div class="form-group">
                                <input type="submit" name="convert-picture-webp" class="btn red col-md-offset-3" value="@T("Admin.System.Maintenance.ConvertPicture.Button")" />
                            </div>
                            @if (Model.ConvertedPictureModel.NumberOfConvertItems >= 0)
                            {
                                <div class="form-group">
                                    <label class="col-md-offset-3">@T("Admin.System.Maintenance.ConvertPicture.Number") : @Model.ConvertedPictureModel.NumberOfConvertItems</label>
                                </div>
                            }
                        </div>
                    </div>
                    <vc:admin-widget widget-zone="maintenance_bottom" additional-data="null" />
                </div>
            </div>
        </div>
    </div>
</form>
